﻿/**
 * <p>Copyright (c) 2016 深圳市鹏途交通科技有限公司</p>
 * <p>					All right reserved. 		 </p>
 * <p>项目名称 ： 	深圳公路信息资源整合及国省检日常化监管管理项目        </p>
 * <p>创建者   :	wy
 * <p>描   述  :  A2-01养护装备与能力建设-培训项目  </p>
 * <p>最后修改 :  $: 2017-4-18-下午3:50:01	wy   $     </p>
 * 
 */

package com.pengtu.gsj.entity.yh;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

@Entity
@Table(name = "T_YH_TRAINING")
public class Training extends IdEntity {

	private static final long serialVersionUID = -6429870906188976336L;
	
	private Date trainStartTime; // 培训开始时间
	
	private Date trainEndTime; // 培训结束时间

	private String trainName; // 名称

	private Integer personCount; // 参加人数

	private String remark; // 备注
	
	private Integer bulletinNumber;   //培训文件数
	
	private List<Attachment> attachments;

	public Training() {
	}
	
	@Column(name = "TRAINSTARTTIME")
	public Date getTrainStartTime() {
		return trainStartTime;
	}

	public void setTrainStartTime(Date trainStartTime) {
		this.trainStartTime = trainStartTime;
	}

	@Column(name = "TRAINENDTIME")
	public Date getTrainEndTime() {
		return trainEndTime;
	}

	public void setTrainEndTime(Date trainEndTime) {
		this.trainEndTime = trainEndTime;
	}

	@Column(name = "TRAINNAME")
	public String getTrainName() {
		return trainName;
	}

	public void setTrainName(String trainName) {
		this.trainName = trainName;
	}

	@Column(name = "PERSONCOUNT")
	public Integer getPersonCount() {
		return personCount;
	}

	public void setPersonCount(Integer personCount) {
		this.personCount = personCount;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}

}
